package com.dream.song.springevent;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @author song_
 * @Date 2020/3/16
 * @desc  事件源
 **/
@Component
public class EventSource {

    @Autowired
    private ApplicationEventPublisher applicationEventPublisher ;

    public void publish(ApplicationEvent event){
        applicationEventPublisher.publishEvent(event);
    }
}
